package com.fowo.api.sys.model;

import com.fowo.api.common.annotaion.TitleField;
import com.fowo.api.sys.entity.enums.SysParamType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Schema(title = "系统参数编辑模型")
@Data
@Accessors(chain = true)
public class SysParamEditModel {

    @Schema(title = "主键编号")
    private Long id;

    @Schema(title = "参数名称")
    @TitleField
    @NotEmpty(message = "参数名称不能为空")
    @Length(max = 255, message = "参数名称最长 255 个字符")
    private String name;

    @Schema(title = "参数说明")
    @NotEmpty(message = "参数说明不能为空")
    @Length(max = 255, message = "参数说明最长 255 个字符")
    private String description;

    @Schema(title = "参数类型")
    @NotNull
    private SysParamType type;

    @Schema(title = "参数值")
    private String value;
}
